<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试按钮</title>
    <script src="//code.jquery.com/jquery-1.12.3.min.js"
            integrity="sha256-aaODHAgvwQW1bFOGXMeX+pC4PZIPsvn2h1sArYOhgXQ="
            crossorigin="anonymous"></script>
    <link href="test.css" type="text/css" rel="stylesheet" />
</head>
<body>
<button type="button" id="B-button">点击加载</button>

<script type="text/javascript">
    $("#B-button").click(function () {
        var self = $(this);
        self.html($("<image src='loading.gif' />"));
        self.attr("disabled", true);

        setTimeout(function () {
            self.html("加载完成");
            self.attr("disabled", false);
        }, 10000);
    });
</script>
</body>
</html>